import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types'
const Home: React.FC = (props: any) => {
  const [count, setCount] = useState(0);
  useEffect(() => {
    document.title = `You clicked ${count} times`;
    setCount(1)
    
  });

  function jump() {
    props.history.push('/login')
  }
  return (
   <div>
       {count}
       <p>{props.color}</p>
       <a onClick={()=> jump()}>跳转到登录</a>
   </div>
  );
};
Home.propTypes = {
  // name: PropTypes.string.isRequired
}
Home.defaultProps = {
  color: 'blue'
};
// ReactDOM.render(<Demo />, mountNode);
export default Home